package org.scalacn.easyscala.interpreter;

public interface Interpreter {
	  /**
	   * Initializes the {@code Interpreter} with {@code context}
	   *  
	   * @param context a non-null {@code ServletContext}.
	   */
	  public void init();

	  /**
	   * Creates a new {@code Context} for the {@code Interpreter},
	   * which represents a single session of state. 
	   *  
	   * @return a non-null {@code Context}
	   */
	  public Context createContext();

	  /**
	   * Executes a script in the {@code Interpreter}.
	   * 
	   * @param context a non-null {@code Context} 
	   * @param script a non-null {@code} snippet of code
	   * @return the result of executing {@code script}
	   *  
	   * @throws Exception if an error occurs during execution
	   */
	  public String execute(String script) throws Exception;
	  //public String execute(Context context, String script) throws Exception;

}
